#pragma once

#include <QtWidgets/QWidget>
#include <QFileInfoList>
#include "ui_CQPlayer.h"

#define cn_tr QStringLiteral

class QVBoxLayout;
class QProgressBar;
class QPushButton;
class QLabel;
class CQPlayer : public QWidget
{
    Q_OBJECT
public:
    CQPlayer(QWidget* parent = Q_NULLPTR);
    void GetFileList(QString path, QFileInfoList& file_list);

signals:
    void changeProcessBar(int now);

private slots:
    void onPlayClicked();
    void onChooseClicked();
    void onSetProcessBar(int now);

private:
    void AddTop();
    void Addmid();
    void AddBot();
    void playPicture();

    QVBoxLayout* mainLay;
    QFileInfoList file_list;
    QProgressBar* progressBar;
    QLabel* path;
    QString m_path;
    QPushButton* play;
    QLabel* mainWin;
    QWidget* botWid;
    QLineEdit* speedNum;
    bool pause_play = true;
};
